/**
 * Created by yangfan on 2016/12/28.
 */

define(["business/home/config/routerconfig",
    'config/appregister',
    "business/services/httpServices",
    "domReady",
    "i18n",
    "business/services/constData",
    "business/services/services",
    "business/services/detailNavComp",
    "jqueryMedia",
    "business/library/directives/engDetailDirective",
    "business/home/directives/translate"],function(routercongfig, app, httpAjax, doc,i18n,constData){
    app.controller('searchCtrl',function($scope,$state,$stateParams,$location,$rootScope){
        $scope.i18n = i18n;
        var param = $stateParams;
        var local = $location.$$path.split('/');
        $scope.curentStateName = $state.current.name;
        $scope.isDetailPage = false;
        $scope.isMainpage = true;
        $scope.showUser = false;
        $scope.navation = constData.searchItem ;
        $scope.GoTo = function(state){
            $state.go(state);
        };
        $scope.styleCollection ={
            border0:{"border-left":"0px solid" }
        };


        //导航页面跳转
        $scope.stateGoTo = function (state,num){
            if(state == "login"){
                var param = $state.current.name;
                sessionStorage.currentUrl = param ;
                if( typeof  num == "number"){
                    sessionStorage.loginType = null;
                    if(num == 0){
                        sessionStorage.loginType = 0;
                    }else if(num ==1){
                        sessionStorage.loginType = 1;
                    }
                }
                $state.go(state);
            }else{
                $state.go(state);
            }
            $scope.curentStateName = state;

        };

        $scope.showNavBox = false;
        $scope.navClass = "f-nav-out";
        //鼠标进入 改变导航区样式
        $scope.changeNav = function(curClass){
            if(curClass=$scope.navClass){
                $scope.navClass = "f-nav-enter";
            }
            $scope.showNavBox = true;
        };
        //鼠标移除 改变导航区样式
        $scope.mouseleave = function(mouseover){
            $scope.showNavBox = false;
            $scope.navClass = "f-nav-out"
        };
        //后台查询数据或缓存中查询数据。
        $scope.data = {
            "username":"Da Anna"
        };
        $scope.placeholder = "请输入您要输入的内容";
        $scope.mainData = {
            logoSrc:"them/images/gcj_big_logo.png"
        }

        // 点击资料 显示下拉框
        $scope.isShowData = false;
        $scope.isInList = false;

        $scope.clickData = function(){
            if($scope.isShowData == false){
                $scope.isShowData = true;
            }
        };

        $scope.leaveSearchList =function(){
            if($scope.isShowData == true){
                $scope.isShowData = false;
            }
            $scope.isInList = true;
        };

        $scope.showBanner = false;
        $scope.onchange = {
            careEnter:function(){
                $scope.showBanner = true;
            },
            careLeave :function(){
                $scope.showBanner = false;
            }
        }
    })
});